OpenCities Map Help

Requirements for a Registered Oracle Connection

The minimum requirements for OpenCities Map to query, insert, edit and post to a registered Oracle connection are:

1. Tables can only have one geometry column

2. Geometry data in a table should be restricted to one geometry type only.

3. Supported geometry types are restricted to point, line, curve, polygon, multipoint, multiline, multicurve, and multipolygon.

4. It is recommended that the table have a spatial index with the LAYER_GTYPE parameter set. This will constrain the table to one geometry type. The following is an example of a CREATE INDEX statement with an explicit geometry type.

CREATE INDEX CUSTOMERS_SIDX ON CUSTOMERS(GEOM)
INDEXTYPE IS MDSYS.SPATIAL_INDEX_V2
PARAMETERS ('layer_gtype=POINT');

Valid layer_gtype values for Map are: POINT, LINE, CURVE, POLYGON, MULTIPOINT, MULTILINE, MULTICURVE, and MULTIPOLYGON.

Note: To determine if a table contains more than one geometry type, use the following query. If the query returns only one row for a single geometry type, then the table meets the one geometry type requirement for OpenCities Map.

SELECT 
t.<geometry column>.SDO_GTYPE, 
COUNT(*) 
FROM<table name>t 
GROUP BY t<geometry column>.SDO_GTYPE;

5. To create a spatial index on a table, it needs to be registered in the appropriate Oracle metadata view. The following example illustrates the CREATE INDEX statement:

INSERT INTO USER_SDO_GEOM_METADATA
(TABLE_NAME, COLUMN_NAME, DIMINFO, SRID) VALUES
('CUSTOMERS', 'GEOM',
SDO_DIM_ARRAY
(SDO_DIM_ELEMENT('LONG', -180.0, 180.0, 0.5),
SDO_DIM_ELEMENT('LAT', -90.0, 90.0, 0.5)),
8307);

6. Every entity (table or view) needs to have a primary key constraint that defines the column (or columns) that uniquely identify rows in that entity. For entities with simple (single-column) primary key constraints, the OpenCities Geospatial Administrator (GSA) can be used to assign a sequence generator to automatically generate unique values for new rows.

Note: Views that are not update-able Oracle views, will require the use of INSTEAD OF Oracle triggers.

Note: It is possible to use the UUID on each OpenCities Map feature as the primary key in Oracle. XFM feature. This translates to a 32 character VARCHAR unique identifier in Oracle. When a UUID is used, the assignment of the unique key is controlled by OpenCities Map. Unlike a primary key, it does not require a sequence.